<%@ page import="com.h.heal.entity.Admin" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="zh">

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>HEAL评论管理</title>
    <jsp:include page="../../common_css.jsp"/>
<style>
    table {
        table-layout: fixed;
    }

    input {
        border-radius: 20px;
        border: none;
        background: rgba(58,58,58,0.20);
        text-align: center;
    }

    td {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
</style>
</head>
<body  style="background: linear-gradient(to top right, #a1ffce 0%, #faffd1 100%);">
<div class="container-scroller">
    <!-- partial:partials/_navbar.html -->
    <jsp:include page="../../top.jsp"/>

    <!-- partial -->

    <div class="container-fluid page-body-wrapper">
        <!-- partial:partials/_sidebar.html -->
        <jsp:include page="../../left.jsp"/>
        <!-- partial -->
        <div style="display: table;width: inherit">
            <div class="row">
                <div class="col-md-12 stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <span class="card-title" style="font-size: 1.875rem;margin-right: 50px">评论列表</span>
                            <%--                            <input type="button" value="添加" onclick="window.location.href='/jsp/product/add.jsp'">--%>
                            <%--                            好康的添加图标--%>
                            <div style="text-align: right">
                                <a class="mdi mdi-plus" href="../../../jsp/admin/comment/add.jsp"
                                   style="font-size: 1.5rem ;margin-right: 50px">添加评论</a>
                            </div>
                            <div class="table-responsive">
                                &nbsp;&nbsp;&nbsp;作者id：<input type="text" id="comment_uid"
                                                                  value="${pageInfo.search1}">
                                &nbsp;&nbsp;&nbsp;视频id：<input type="text" id="comment_vid"
                                                                value="${pageInfo.search2}">
                                &nbsp;&nbsp;&nbsp;<input type="button" onclick="doSearch(1)" value="查询">
                                <%--                                &nbsp;&nbsp;&nbsp;<input type="button" onclick="doSearch()" value="查询">--%>

                                <table id="recent-purchases-listing" class="table">
                                    <thead>
                                    <tr>
                                        <th>评论cid</th>
                                        <th>作者uid</th>
                                        <th>视频vid</th>
                                        <th>上传时间</th>
                                        <th>正文预览</th>
                                        <%--                                        <th>播放量</th>--%>
                                        <th>点赞数</th>
                                        <%--                                        <th>url</th>--%>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach var="item" items="${pageInfo.list}">
                                        <tr>
                                            <td>${item.comment_cid}</td>
                                            <td>${item.comment_uid}</td>
                                            <td>${item.comment_vid}</td>
                                            <td>${item.comment_timestamp}</td>
                                            <td>${item.comment_maintext}</td>

                                            <td>${item.comment_like}</td>

                                            <td>
                                                <a></a>
                                                <a href="#" class="mdi mdi-close"
                                                   onclick="if (confirm('确认要删除选中的记录吗？')){window.location.href='/comment/delete/${item.comment_cid}'}">删除</a>

                                            </td>
                                        </tr>
                                    </c:forEach>


                                    </tbody>
                                </table>
                                <jsp:include page="../../page.jsp"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- content-wrapper ends -->
    <!-- partial:partials/_footer.html -->
    <%--        <footer class="footer">--%>
    <%--            <div class="d-sm-flex justify-content-center justify-content-sm-between">--%>
    <%--                <span class="text-muted d-block text-center text-sm-left d-sm-inline-block">Copyright © bootstrapdash.com 2020</span>--%>
    <%--                <span class="float-none float-sm-right d-block mt-1 mt-sm-0 text-center"> Free <a--%>
    <%--                        href="https://www.bootstrapdash.com/" target="_blank">Bootstrap dashboard template</a> from Bootstrapdash.com</span>--%>
    <%--            </div>--%>
    <%--        </footer>--%>
    <!-- partial -->
    <jsp:include page="../../footer.jsp"/>
</div>
<!-- main-panel ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
<!-- container-scroller -->
<jsp:include page="../../common_js.jsp"/>
</body>

</html>
<script>
    function doSearch(pageNum) {
        var comment_uid = $("#comment_uid").val();
        var comment_vid = $("#comment_vid").val();
        window.location.href = "/comment/main?pageNum=" + pageNum + "&comment_uid=" + comment_uid + "&comment_vid=" + comment_vid;

    }
</script>


